package com.slimbloody;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.LinkedHashMap;
import java.util.Optional;
import java.util.Set;

@AllArgsConstructor
@NoArgsConstructor
@Data
class LowerPriceDrugContext {
  // k: drugId, v: List<LowerPriceDrugInfo>中, 价格最高的
  private LinkedHashMap<Integer, BigDecimal> drugPriceMap;

  // searchKey
  private String key;

  // isActive
  private Boolean isFilterActive;

  // 药店类型
  private Integer storeSubType;

  // 药店类型对应的relatedDrugId白名单
  Set<Integer> subNearExpiryDrugWhiteList;

  // Map<Integer, List<Integer>> subNearExpiryDrugWhiteListMap;

  /** 低价提权的药品ID **/
  private Set<Integer> drugIds;
}

public class T1 {
  public static void main(String[] args) {
    LowerPriceDrugContext lowerPriceDrugContext = null;
    LinkedHashMap<Integer, BigDecimal> drugPriceMap = Optional
      .ofNullable(lowerPriceDrugContext)
      .map(LowerPriceDrugContext::getDrugPriceMap)
      .orElse(null);

    System.out.println(drugPriceMap);
  }
}
